<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Go语言通用代码生成器：仙童</title>
<link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../easyui/demo/demo.css">
<script type="text/javascript" src="../easyui/jquery.min.js"></script>
<script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
<script src="../uploadjs/vendor/jquery.ui.widget.js"></script>
<script src="../uploadjs/jquery.iframe-transport.js"></script>
<script src="../uploadjs/jquery.fileupload.js"></script>
<style>
.bar {
    height: 18px;
    background: green;
}
.fairchild {
	background:url(../css/images/fc.png);
   	background-size:30%,30%;
    background-repeat:no-repeat;
    background-position:500px 0px;
    mix-blend-mode:darken;
}
</style>
</head>
<body class="easyui-layout">
<div data-options="region:'north',border:false" style="height:95px;overflow:hidden;background:#B3DFDA;padding:8px">
	<h1 style="font-size:16pt;"><a style="text-decoration: none;color:black;" href="https://gitee.com/jerryshensjf/Fairchild">Go语言通用代码生成器：仙童</a></h1><a style="text-decoration: none;color:black;position: absolute;top:30px;left:300px;font-size:10pt;" href="https://gitee.com/jerryshensjf/Fairchild">官网</a>
	<h2 style="font-size:9pt;"><a style="text-decoration: none;color:black;" href="https://gitee.com/jerryshensjf/Fairchild">自2014年起为公众服务</a></h2>
</div>
<div data-options="region:'west',split:true,title:'主菜单'" style="width:270px;padding:0px;">
<div class="easyui-accordion" data-options="fit:true,border:false">       						
<div title="功能菜单" style="padding:0px" data-options="selected:true">
<div id="mmadmin" data-options="inline:true" style="width: 250px; height: 98%; overflow: scroll; left: 0px; top: 0px; outline: none; display: block;" class="menu-top menu-inline menu easyui-fluid" tabindex="0"><div class="menu-line" style="height: 122px;"></div>
<div onclick="switchUrl('../html/index.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">上传生成代码</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../html/excelWizard.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">模板向导生成代码</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../html/compare.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">生成差异版本代码</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../tools/multiTokenReplacer.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">贴心小工具</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../onlineqa/empty.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">空白Excel模板</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/TFEnumN18DummyDemo.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载TFEnumN18DummyDemo示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/TFGirlOnlyN21.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载TFGirlOnlyN21示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/TFEnumPgN18Demo.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载TFEnumPgN18Demo示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/LoginSample.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载LoginSample示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/RLCourseManagementPg.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载RLCourseManagementPg示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/RLGirlOnlyPg.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载RLGirlOnlyPg示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/TFCourseManagementOra.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载TFCourseManagementOra示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/RLEnumDemo.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载RLEnumDemo示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/RLEnumDemoOra.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载RLEnumDemoOra示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/TFEnumDummyDemo.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载TFEnumDummyDemo示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/TFDemoDummy.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载TFDemoDummy示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/RLGirlOnly.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载RLGirlOnly示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/RLCourseManagement.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载RLCourseManagement示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/TFOneDummy.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载TFOneDummy示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/TFOne.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载TFOne示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/CourseManagement.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载CourseManagement示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/GirlOnly.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载GirlOnly示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/GirlOnlyInit.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载GirlOnlyInit示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/CivMariaSample.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载CivMariaSample示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/CivPgSample.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载CivPgSample示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/CivOracleSample.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载CivOracleSample示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/UserSystem.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载UserSystem示例</div><div class="menu-icon icon-add"></div></div>

<div onclick="window.location='../spreadsheettemplates/CivMariaSampleJ.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载CivMariaSampleJ示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/CourseManagementPgJ.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载CourseManagementPgJ示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/GirlOnlyOracleJ.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载GirlOnlyOracleJ示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/CivMariaSampleRu.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载CivMariaSampleRu示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../spreadsheettemplates/GirlOnlyRu.xls'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载GirlOnlyRu示例</div><div class="menu-icon icon-add"></div></div>

<div onclick="window.location='../docs/Fairchild_InstallUsage.docx'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载安装运行文档</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/Fairchild_UserManual.docx'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载用户手册</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/动词算子式代码生成器开发者手册.pptx'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载开发者手册</div><div class="menu-icon icon-add"></div></div>

<div onclick="switchUrl('../onlineqa/node21_18_14_frontend.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">Nodejs前端代码生成物运行指南</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../onlineqa/newfunc.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">新版本新功能介绍</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../onlineqa/verbdenies.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">动词否定在线文档</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../onlineqa/onlineqa_index.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">在线问答</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../onlineqa/about.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">生成器简介</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../onlinedoc/luantan_index.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">代码生成器技术乱弹</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/Infinity面向棱柱动词算子式通用目的代码生成器详细设计.ppt'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载原理文档一</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/动词算子式通用目的代码生成器基础理论讲纲.pptx'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载原理文档二</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/代码生成原理浅析.ppt'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载原理文档三</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/超级语言.pptx'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载原理文档四</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/动词算子式代码生成器设计技术理论及实现.pptx'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载原理文档五</div><div class="menu-icon icon-add"></div></div>

</div>
</div>
</div>
</div>
<div data-options="region:'east',split:true,collapsed:true,title:'属性'" style="width:250px;overflow: hidden">
</div>
<div data-options="region:'south',border:false" style="height:50px;background:#A9FACD;padding:10px;text-align: center">火箭船软件工作室版权所有。作者电邮:jerry_shen_sjf@qq.com QQ群:277689737</div>
<div data-options="region:'center',title:'代码生成器功能区'">
<div title="生成结果面板" class="easyui-panel" style="width:1200px;height:160px">
<div style="float:left;font-size:12pt">生成结果:</div><br/><br/>
<div id="generateResults"></div>
<div style="clear:both"></div>
</div>
<div title="Excel生成代码面板" class="easyui-panel fairchild" style="width:1200px;height:400px">
<input id="fileupload" type="file" name="files[]" data-url="../facade/exceltoProjectFacade" multiple onfocus="$('#generateResults').html('')"><br>
<input type="checkbox" id="ignoreWarning" name="ignoreWarning" value="true" />忽略编译警告<br>
<input type="checkbox" id="genFormatted" name="genFormatted" checked value="true" />生成格式化模板<br>
<input type="checkbox" id="generateFront" name="generateFront" checked value="true" />生成前端<br>
<input type="checkbox" id="autoConfig" name="autoConfig" checked value="true" onchange="toggleAutoConfig()"/>根据技术栈自动设置前端基地址<br>
<input type="checkbox" id="frontUseProjectName" name="frontUseProjectName" value="true" disabled/>前端API使用项目名<br>
<input type="checkbox" id="frontUseControllerPrefix" name="frontUseControllerPrefix" value="true" disabled/>前端基地址使用控制器包名<br>
<input type="checkbox" id="sqlComments" name="sqlComments" checked value="true" />数据库脚本增加注释<br>
<input type="checkbox" id="javaCompatibility" name="javaCompatibility" checked value="true" />使用Java兼容性<br>
<input type="checkbox" id="rustCompatibility" name="rustCompatibility" checked value="true" />使用Rust兼容性<br>
<input type="checkbox" id="useAdvancedCustomize" name="useAdvancedCustomize" value="true" onchange="checkUseCust()"/>后端使用高级定制功能<br>
<div style="font-size:11pt;display:none;margin-left:20px" id="useCust">
&nbsp;&nbsp;<input type="checkbox" id="genUi" name="genUi" checked value="true" />生成界面
&nbsp;&nbsp;<input type="checkbox" id="genController" name="genController" checked value="true" />生成Controller
&nbsp;&nbsp;<input type="checkbox" id="genServiceImpl" name="genServiceImpl" checked value="true" />生成Service
&nbsp;&nbsp;<input type="checkbox" id="genDaoImpl" name="genDaoImpl" checked value="true" />生成Dao
</div>
<input type="checkbox" id="useUserPartial" name="useUserPartial" value="true" onchange="checkUseUserPartial()"/>后端使用部分生成功能<br>
<div style="font-size:11pt;display:none" id="usePartial">
<textarea id="exportStr" name="exportStr" cols="32" rows="4" style="margin-left:20px">
</textarea>
</div>
<br/>
<a href="../onlineqa/node21_18_14_frontend.html">请参考Nodejs21,18,14前端代码生成物运行指南</a><br><br>
<a href="../onlineqa/newfunc.html">新版本新功能介绍</a><br><br>
<a href="../onlineqa/empty.html">请参考空白Excel模板</a><br><br>
<a href="../onlineqa/verbdenies.html">请参考动词否定在线文档</a><br><br>
<a href="../onlineqa/about.html">Go语言通用代码生成器：仙童的简介</a>
<br>
</div>
</div>
</body>
<script type="text/javascript">
$(function () {	
	//alert($("#javaCompatibility").prop("checked"));
    $('#fileupload').fileupload({
        dataType: 'json',  
        formData : function() {
            return [{name:"ignoreWarning",value:$("#ignoreWarning").prop("checked")},
            		{name:"genFormatted",value:$("#genFormatted").prop("checked")},
            		{name:"generateFront",value:$("#generateFront").prop("checked")},
            		{name:"autoConfig",value:$("#autoConfig").prop("checked")},
            		{name:"frontUseProjectName",value:$("#frontUseProjectName").prop("checked")},
            		{name:"frontUseControllerPrefix",value:$("#frontUseControllerPrefix").prop("checked")},
            		{name:"sqlComments",value:$("#sqlComments").prop("checked")},
            		{name:"javaCompatibility",value:$("#javaCompatibility").prop("checked")},
            		{name:"rustCompatibility",value:$("#rustCompatibility").prop("checked")},
            		
            		{name:"useAdvancedCustomize",value:$("#useAdvancedCustomize").prop("checked")},
            		{name:"genUi",value:$("#genUi").prop("checked")},
            		{name:"genController",value:$("#genController").prop("checked")},
            		{name:"genService",value:true},
            		{name:"genServiceImpl",value:$("#genServiceImpl").prop("checked")},
            		{name:"genDao",value:true},
            		{name:"genDaoImpl",value:$("#genDaoImpl").prop("checked")},
            		
            		{name:"useUserPartial",value:$("#useUserPartial").prop("checked")},
            		{name:"exportStr",value:$("#exportStr").val()},
            	];
        },
        success: function(data, textStatus) {
			//debugger;
	           if (data.success == true){	        	   
           			var content = "<strong>"+data.projectName+"</strong><a href=\"../source/"+data.projectName+".zip\">点击下载后端项目</a><br>";
           			if (!isBlank(data.frontProjectName)) content +=	"<strong>"+data.frontProjectName+"</strong><a href=\"../source/"+data.frontProjectName+".zip\">点击下载前端项目</a><br>";
    				$("#generateResults").html(content);
	           }else if (data.success == false){
	        	   var resultStr ="";
	        	   if (data.compileErrors.length > 0) {
		        	   resultStr = "<span style='color:red;font-size:16pt''>";
		        	   for (var i = 0; i < data.compileErrors.length;i++){
		        		   resultStr += data.compileErrors[i];
		        		   resultStr += "<br/>"
	        	 		   }   
		        	   resultStr += "</span>";
		           }
	        	   if ($("#ignoreWarning").prop("checked")==false && data.compileWarnings.length > 0){
		        	   resultStr += "<br/><span style='color:#cd740c;font-size:16pt'>";    	   		 
		        	   for (var i = 0; i < data.compileWarnings.length;i++){
		        		   resultStr += data.compileWarnings[i];
		        		   resultStr += "<br/>"
        	 		    }
	        	   		resultStr += "</span>";
	        	   }
	        	   if (!!resultStr) $("#generateResults").html(resultStr);
	           }
	        },
	        
        progressall: function (e, data) {
            var progress = parseInt(data.loaded / data.total * 100, 10);
            $("#generateResults").html("");
        },
	});
});

function toggleAutoConfig(){
	if ($("#autoConfig").get(0).checked==true){
		$("#frontUseProjectName").attr("disabled","disabled");
		$("#frontUseControllerPrefix").attr("disabled","disabled");
	}else{
		$("#frontUseProjectName").removeAttr("disabled");
		$("#frontUseControllerPrefix").removeAttr("disabled");
	}
}

function Write2Text(filename)
{
	var fso = new ActiveXObject("Scripting.FileSystemObject");
	var f = fso.CreateTextFile(filename, true);
	for(var i=0;i<arr.length;i++)
	{
	f.write(arr[i])
	f.WriteBlankLines(1)
	}
	f.Close();
}

function readText(myfilename){
	$("#generateResults").html("");
	$.ajax({
        type: "get",
        url: "../facade/readSgsFileFacade",
        data: {filename:myfilename},
        dataType: 'text',
        success: function(data, textStatus) {
           //alert(data);
           if ( data != null & data!="")
           		$("#mycode").val(data);
        },
        complete : function(XMLHttpRequest, textStatus) {
        
		},
		error : function(XMLHttpRequest,textStatus,errorThrown) {
			alert("Error:"+textStatus);
			//alert(errorThrown.toString());
		}
    });	 
}

function readDocs(myfilename){
	$.ajax({
        type: "post",
        url: "../facade/readDocsFileFacade",
        data: {filename:myfilename},
        dataType: 'text',
        success: function(data, textStatus) {
           //alert(data);
           if ( data != null & data!="")
           		$("#mycode").val(data);
        },
        complete : function(XMLHttpRequest, textStatus) {
        
		},
		error : function(XMLHttpRequest,textStatus,errorThrown) {
			alert("Error:"+textStatus);
			//alert(errorThrown.toString());
		}
    });	 
}

function switchUrl(url){
	window.location.href=url;
}

function isBlank(val){
	if (val == undefined|| val == null || val == "" || val== "0" || val == 0) return true;
	else return false;
}

function  checkUseCust(){
	if ($("#useAdvancedCustomize").get(0).checked==true){
		$.messager.confirm("警告", "高级定制可能使代码生成物通不过编译，确定使用？", function (data) {
		    if (data) {
		    	$("#useAdvancedCustomize").get(0).checked=true;
		    	$("#useCust").css("display","block");
		     }else {
		    	 $("#useAdvancedCustomize").get(0).checked=false;
		    	 $("#useCust").css("display","none");
		     }
		});
	}else{
		$("#useCust").css("display","none");
	}
}

function  checkUseUserPartial(){
	if ($("#useUserPartial").get(0).checked==true){
		$.messager.confirm("警告", "部分生成功能可能使代码生成物通不过编译，确定使用？", function (data) {
		    if (data) {
		    	$("#useUserPartial").get(0).checked=true;
		    	$("#usePartial").css("display","block");
		     }else {
		    	 $("#useUserPartial").get(0).checked=false;
		    	 $("#usePartial").css("display","none");
		     }
		});
	}else{
		$("#usePartial").css("display","none");
	}
}
</script>
</html>